#ifndef QFACEOBJECT_H
#define QFACEOBJECT_H

#include <QObject>
#include <seeta/FaceEngine.h>
#include <opencv2/opencv.hpp>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDateTime>
#include <QDebug>

class QFaceObject : public QObject
{
    Q_OBJECT
public:
    explicit QFaceObject(QObject *parent = nullptr);
    ~QFaceObject();

public slots:
    int64_t face_register(cv::Mat &faceImage);
    void face_query(cv::Mat &faceImage, float similarityThreshold);
    int64_t face_query_for_duplicate_check(cv::Mat &faceImage, float similarityThreshold);

private:
    SeetaImageData convertMatToSeetaImage(cv::Mat &faceImage);

signals:
    void send_faceid(int64_t faceId);              // 发送人脸识别结果的信号
    void sendEmployeeDataToClient(int employeeID); // 发送员工完整数据的信号

private:
    seeta::FaceEngine *fengineptr;
    QSqlDatabase database;

    void initSeetaFace(); // SeetaFace初始化函数
};

#endif // QFACEOBJECT_H
